<?php 
/**
 * 添加属性视图
 */
	class AttrAction extends CommonAction{
		public function index(){
			$this->attr=M('attr')->select();
			$this->display();
		}

		public function attr(){
			$this->display();
		}

		// 添加属性表单处理
		public  function addAttr(){
			$attr=$_POST;
			if(M('attr')->add($attr))$this->success('添加成功!',U(GROUP_NAME.'/Attr/index'));
			else $this->error('添加失败!');
		}

		//删除属性
		public function delAttr(){
			$id=$_GET['id'];
			if(M('attr')->delete($id))$this->success('删除成功!',U(GROUP_NAME.'/Attr/index'));
			else $this->error('删除失败!');
		}
	}